package com.wunong.smart.collection.domain.state;

import com.wunong.smart.collection.application.request.BaseCollectionRequest;
import com.wunong.smart.collection.application.request.CancelCollectionRequest;
import com.wunong.smart.collection.application.request.CollectRequest;
import com.wunong.smart.collection.domain.model.CollectionDomain;
import com.wunong.smart.domain.platform.exception.ServiceException;

/**
 * @author create by zealot.zt
 */
public interface CollectionState {

    /**
     * 收藏
     *
     * @param request
     * @param domain
     * @return
     */
    default Long collect(CollectRequest request, CollectionDomain domain) {
        throw new ServiceException("不支持收藏，请刷新页面重试");
    }

    /**
     * 取消收藏
     *
     * @param request
     * @param domain
     * @return
     */
    default Void cancel(CancelCollectionRequest request, CollectionDomain domain) {
        throw new ServiceException("不支持取消收藏，请刷新页面重试");
    }

    /**
     * 执行对应的操作
     *
     * @param request
     * @param domain
     * @return
     */
    Object operate(BaseCollectionRequest request, CollectionDomain domain);

    /**
     * 当前的状态
     *
     * @return
     */
    Integer getStatus();

}
